<include file="public/head"/>
<include file="public/scripts"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
    .well {
        margin:0px 0px 0px 0px;
    }
</style>
<body>
<div class="wrap js-check-wrap">
    <form class="well form-inline margin-top-20" method="post" action="">
        <tr>
            <th>订单状态：</th>
            <td>
                <select class="form-control" name="status" id="input-parent_id">
                    <option value="">所有</option>
                    <option value="0">待付款</option>
                    <option value="1">待发货</option>
                    <option value="2">已完成</option>
                </select>
            </td>
        </tr>        
        <input class="form-control" type="text" name="order_sn" style="width: 200px;" value="{$order_sn}" placeholder="请输入订单号">
        <input class="form-control" type="text" name="consignee" style="width: 200px;" value="{$consignee}" placeholder="请输入收货人">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="">清空</a>
    </form>    
    <form class="js-ajax-form" action="" method="post">
        <br>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <td>订单号</td>
                <td>下单时间</td>
                <td>收货人</td>
                <td>总金额</td>
                <td>应付金额</td>
                <td>订单状态</td>
                <td>操作</td>
            </tr>
            </thead>
            <foreach name="p_list" item="vo">
                <tr>                   
                    <td>{$vo.order_sn}</td>
                    <td>{:date('Y-m-d H:i:s',$vo.add_time)}</td>
                    <td>{$vo.consignee}[TEL:{$vo.tel}]<br>{$vo.address}</td>
                    <td>{$vo.goods_amount}</td>
                    <td>{$vo.order_amount}</td>
                    <td>
                        <?php 
                            switch($vo['order_status']){
                                case 0:

                                    echo "未确认,";
                                    break;
                                case 1:
                                    echo "已确认,";
                                    break;                
                                case 2:
                                    echo "<span style=\"color:red;\">已取消,</span>";
                                    break;  
                                default:  
                                    echo "<span style=\"color:red;\">无效,</span>";
                                    break;                                            
                            }
                            switch($vo['pay_status']){
                                case 0:
                                    echo "未付款,";
                                    break;
                                               
                                case 2:
                                    echo "已付款,";
                                    break;  
                                default:             
                            } 
                            switch($vo['shipping_status']){
                                case 0:
                                    echo "未发货";
                                    break;
                                case 1:
                                   echo "已发货";
                                    break;                           
                                case 2:
                                    echo "收货确认";
                                    break;  
                                default:             
                            }                            
                        ?>
                    </td>
                    <td>
                        <a href="{:cmf_plugin_url('QbtOrder://AdminIndex/detail?order_id='.$vo.order_id)}">查看</a>
                        <a href="{:cmf_plugin_url('QbtOrder://AdminIndex/delOrder?order_id='.$vo.order_id)}" class="js-ajax-delete">移除</a>
                    </td>
                </tr>
            </foreach>
        </table>
        <ul class="pagination">{$page|default=''}</ul>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer/layer.js"></script>
</body>
</html>
